export class Istore {
  id?: number;
  name = "";
  "introduction" = "";
  "phone" = "";
  "address" = "";
  "detailedAddress" = "";
  "image" =
    "https://tse4-mm.cn.bing.net/th/id/OIP-C.nZv7UXY2CIf0LAzYHVKyIAHaHa?w=199&h=199&c=7&r=0&o=5&pid=1.7";
  "latitude" = "";
  "longitude" = "";
  "validTime" = "";
  "dayTime" = "";
  "isShow" = true;
  "isDel" = false;

  constructor(data?: Istore) {
    data && this.setProps(data);
  }

  setProps(data: Istore) {
    (Object.keys(this) as Array<keyof IIstore>).forEach((key) => {
      // @ts-ignore
      this[key] = data[key];
    });
  }
}

export type IIstore = Omit<Istore, "setProps">;
